﻿using FinanceAPI.Model;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace FinanceAPI.Core
{
    public class FinanceDbContext : DbContext
    {
        public FinanceDbContext(DbContextOptions<FinanceDbContext> options)
            : base(options)
        {
        }

        public DbSet<PdEntityVourcher> PdVourchers { get; set; }

        public DbSet<PdEntityBalance> PdBalances { get; set; }

        public DbSet<PdEntitySubjectCodeSetting> PdSubjectCodeSettings { get; set; }

        public DbSet<PdEntitySubject> PdEntitySubjects { get; set; }

        public DbSet<SubjectSetting> SubjectSettings { get; set; }

        public DbSet<PdEntityVourcherWarning> PdEntityVourcherWarnings { get; set; }

        public DbSet<PdEntityVourcherProject> PdEntityProjects { get; set; }

        public DbSet<PdEntityVourcherCustomer> PdVourcherCustomers { get; set; }

        public DbSet<PdEntityOrganization> PdOrganizations { get; set; }

        public DbSet<PdEntityDebit> PdDebits { get; set; }

        public DbSet<PdEntityVourcherLog> PdVourcherLogs { get; set; }

        public DbSet<凭证辅助账> PdSubsidiarys { get; set; }

        public DbSet<核算项> PdAccountings { get; set; }

        public DbSet<PdEntityVourcherSetting> PdEntityVourcherSettings { get; set; }

        

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //modelBuilder.Entity<SubsidiaryAccount>(u =>
            //{
            //    //u.HasOne(x => x.Vourcher).WithMany().HasForeignKey(x => x.VourcherId).OnDelete(DeleteBehavior.Restrict);
            //});
        }
    }
}
